//
//  DingDanTableViewCell.m
//  Experss
//
//  Created by Chen on 2017/8/3.
//  Copyright © 2017年 嗯，大葱. All rights reserved.
//

#import "DingDanTableViewCell.h"

#import "DingDanTableCollectionViewCell.h"


#import "TuiHuanViewController.h"//退换货
#import "WuLiuViewController.h"//物流
#import "GoodsMingXiViewController.h"//商品明细
#import "CancelDingDanView.h" //小通提示删除订单
#import "PingLunViewController.h"//评论
#import "PayForViewController.h"//支付界面

#import "DingDanOrdermodle.h"
#import "DingDanShopModle.h"
#import "DingDanSkuListMoldle.h"
#import "PublicLanguageVController.h"
#import "TuiHuanDetailViewController.h"//退换货详情

@interface DingDanTableViewCell ()<UICollectionViewDelegate,UICollectionViewDataSource,CancelDingDanViewDelegate>
{
    UIViewController *currentVC;
    NSString *orderStrT;
}

/**  */
@property (nonatomic , strong) UILabel *titleLabel;

/**  */
@property (nonatomic , strong) UILabel *stateLabel;

/**  */
@property (nonatomic , strong) UICollectionView *collectionView;

/**  */
@property (nonatomic , strong) UIImageView *moreImageView;

/**  */
@property (nonatomic , strong) UILabel *priceLabel;

/**  */
@property (nonatomic , strong) UIButton *rightBtn;//立即支付

/**  */
@property (nonatomic , strong) UIButton *midBtn;//查看物流

/**  */
@property (nonatomic , strong) UIButton *midBtn2;//取消订单

/**  */

/**  */
@property (nonatomic , strong) NSMutableArray *imageArray;

/**  */
@property (nonatomic , strong) UIButton *rightBtnTuihuan;//退换货右边
@property (nonatomic , strong) UIButton *rightSureBtn;//确认收货

@property (nonatomic, strong)UIButton *rightDelete;//删除订单




@property (nonatomic , strong)DingDanShopModle *shopResult;
@property (nonatomic , strong)DingDanOrdermodle *orderResult;
 

@end

@implementation DingDanTableViewCell

-(void)setModle:(DingDanModle *)Modle{
    _Modle = Modle;
    
    self.imageArray = [NSMutableArray array];
    //        self.imageArray = @[@"",@"",@"",@"",@"",@""];
    
    _shopResult = [DingDanShopModle mj_objectWithKeyValues:self.Modle.shop_data];
    _orderResult = [DingDanOrdermodle mj_objectWithKeyValues:self.Modle.order_data];
    
    
    for (DingDanSkuListMoldle *skuListModle in _orderResult.sku_list) {
        [self.imageArray addObject:skuListModle.sku_image];
    }
    
    [self createSubviews];
    
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        currentVC = [BasePublicClass getCurrentVC];
    }
    return self;
}

- (void)createSubviews{
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, 200, 47)];
    label.text = _shopResult.shop_name;
    label.textAlignment = NSTextAlignmentLeft;
    label.textColor = [UIColor blackColor];
    label.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:label];
    self.titleLabel = label;
    
    CGFloat xxx = kScreen_Width - 70;
    
    UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(xxx, 0, 70, 47)];
    
    //订单状态 1生成订单,2支付订单,3已经发货,4完成订单,5已经评价6退款,7部分退款8用户取消订单,9作废订单,10退款中
    label2.text = _orderResult.status_name;
    
    
    
    
    label2.textAlignment = NSTextAlignmentCenter;
    label2.textColor = RGBAColor(52, 140, 245, 1);
    label2.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:label2];
    self.stateLabel = label2;
    

    
    UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
    layout.minimumInteritemSpacing = 7;
    layout.minimumLineSpacing = 7;
    layout.sectionInset = UIEdgeInsetsMake(26, 15, 6, 25);
    CGFloat width = (kScreen_Width - 40 - 30 - 40)/5.0;
    layout.itemSize = CGSizeMake(width, width);
    layout.scrollDirection = UICollectionViewScrollDirectionVertical;
    
    UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 47, kScreen_Width-40, width + 26+6 +0.01) collectionViewLayout:layout];
    collectionView.backgroundColor = [UIColor whiteColor];
    collectionView.showsVerticalScrollIndicator = NO;
    collectionView.showsHorizontalScrollIndicator = NO;
    collectionView.bounces = NO;
    collectionView.scrollEnabled = NO;
    [collectionView registerClass:[DingDanTableCollectionViewCell class] forCellWithReuseIdentifier:@"cell"];
    collectionView.delegate = self;
    collectionView.dataSource = self;
    self.collectionView = collectionView;
    [self.contentView addSubview:collectionView];
    collectionView.userInteractionEnabled = NO;
    
    
    if (self.imageArray.count>5) {
        UIImageView *imgV = [BasePublicCreatUI createImageViewFrame:CGRectMake(kScreen_Width-40, 47 + 26 + (width-30)/2.0, 30, 30) imageName:@"tijiaodingdan_dian" color:[UIColor whiteColor]];
        imgV.contentMode = UIViewContentModeScaleAspectFit;
        self.moreImageView = imgV;
        [self.contentView addSubview:imgV];
    }
    
    
    UILabel *label3 = [[UILabel alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(self.collectionView.frame), SCREEN_WIDTH-30, 40)];
    label3.text = [NSString stringWithFormat:@"¥%@ 共%@件 重量%@kg",_orderResult.order_price,_orderResult.all_sku_num,_orderResult.all_sku_weight];//@"¥399.0 共7件，重量2.5kg";
    label3.textAlignment = NSTextAlignmentLeft;
    label3.textColor = [UIColor blackColor];
    label3.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:label3];
    
    self.priceLabel = label3;
    
    // 创建按钮
    CGFloat w = 90;
    CGFloat space = 15;
    CGFloat xbtx = SCREEN_WIDTH - w - space;
    CGFloat yy = CGRectGetMaxY(label3.frame) + 10;
    
    
    UIButton *btn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn.frame = CGRectMake(xbtx, yy, w, 35);
    btn.backgroundColor = [UIColor whiteColor];
    [btn setTitle:@"立即支付" forState:(UIControlStateNormal)];
    btn.titleLabel.font = [UIFont systemFontOfSize:14];
    [btn setTitleColor:RGBAColor(75, 170, 251, 1) forState:(UIControlStateNormal)];
    [btn addTarget:self action:@selector(zhifuORshouhuoORchakan) forControlEvents:(UIControlEventTouchUpInside)];
    btn.layer.cornerRadius = 35/2.0;
    btn.layer.borderWidth = 1;
    btn.layer.borderColor = RGBAColor(75, 170, 251, 1).CGColor;
    btn.clipsToBounds = YES;
    btn.hidden = YES;
    [self.contentView addSubview:btn];
    
    self.rightBtn = btn;
    
    
    UIButton *btn55 = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn55.frame = CGRectMake(xbtx, yy, w, 35);
    btn55.backgroundColor = [UIColor whiteColor];
    [btn55 setTitle:@"删除订单" forState:(UIControlStateNormal)];
    btn55.titleLabel.font = [UIFont systemFontOfSize:14];
    [btn55 setTitleColor:RGBAColor(75, 170, 251, 1) forState:(UIControlStateNormal)];
    [btn55 addTarget:self action:@selector(deleteOrder:) forControlEvents:(UIControlEventTouchUpInside)];
    btn55.layer.cornerRadius = 35/2.0;
    btn55.layer.borderWidth = 1;
    btn55.layer.borderColor = RGBAColor(75, 170, 251, 1).CGColor;
    btn55.clipsToBounds = YES;
    btn55.hidden = YES;
    [self.contentView addSubview:btn55];
    self.rightDelete = btn55;
    
    
    
    
    UIButton *btn222 = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn222.frame = CGRectMake(xbtx, yy, w, 35);
    btn222.backgroundColor = [UIColor whiteColor];
    [btn222 setTitle:@"确认收货" forState:(UIControlStateNormal)];
    btn222.titleLabel.font = [UIFont systemFontOfSize:14];
    [btn222 setTitleColor:RGBAColor(75, 170, 251, 1) forState:(UIControlStateNormal)];
    [btn222 addTarget:self action:@selector(sureGetGoodsAction:) forControlEvents:(UIControlEventTouchUpInside)];
    btn222.layer.cornerRadius = 35/2.0;
    btn222.layer.borderWidth = 1;
    btn222.layer.borderColor = RGBAColor(75, 170, 251, 1).CGColor;
    btn222.clipsToBounds = YES;
    btn222.hidden = YES;
    [self.contentView addSubview:btn222];
    self.rightSureBtn = btn222;
    
    
    
    
    
    
    CGFloat xbtx2 = SCREEN_WIDTH - 2*w - 2*space;
    
    UIButton *btn2 = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn2.frame = CGRectMake(xbtx2, yy, w, 35);
    btn2.backgroundColor = [UIColor whiteColor];
    [btn2 setTitle:@"查看物流" forState:(UIControlStateNormal)];
    btn2.titleLabel.font = [UIFont systemFontOfSize:14];
    [btn2 setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
    [btn2 addTarget:self action:@selector(wuliuORquxiao) forControlEvents:(UIControlEventTouchUpInside)];
    btn2.layer.cornerRadius = 35/2.0;
    btn2.layer.borderWidth = 1;
    btn2.layer.borderColor = [UIColor lightGrayColor].CGColor;
    btn2.clipsToBounds = YES;
    btn2.hidden = YES;
    [self.contentView addSubview:btn2];
    
    self.midBtn = btn2;
    
    
    
    UIButton *btn22 = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn22.frame = CGRectMake(xbtx2, yy, w, 35);
    btn22.backgroundColor = [UIColor whiteColor];
    [btn22 setTitle:@"取消订单" forState:(UIControlStateNormal)];
    btn22.titleLabel.font = [UIFont systemFontOfSize:14];
    [btn22 setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
    [btn22 addTarget:self action:@selector(cencleOrderAction:) forControlEvents:(UIControlEventTouchUpInside)];
    btn22.layer.cornerRadius = 35/2.0;
    btn22.layer.borderWidth = 1;
    btn22.layer.borderColor = [UIColor lightGrayColor].CGColor;
    btn22.clipsToBounds = YES;
    btn22.hidden = YES;
    [self.contentView addSubview:btn22];
    self.midBtn2 = btn22;
    
    
    
    
    
    
    
    CGFloat xbtx3 = SCREEN_WIDTH - 2*w - 3*space - 70;
    UIButton *btn3 = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn3.frame = CGRectMake(xbtx3, yy, 70, 35);
    btn3.backgroundColor = [UIColor whiteColor];
    [btn3 setTitle:@"退换货" forState:(UIControlStateNormal)];
    btn3.titleLabel.font = [UIFont systemFontOfSize:14];
    [btn3 setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
    [btn3 addTarget:self action:@selector(tuihuo) forControlEvents:(UIControlEventTouchUpInside)];
    btn3.layer.cornerRadius = 35/2.0;
    btn3.layer.borderWidth = 1;
    btn3.layer.borderColor = [UIColor lightGrayColor].CGColor;
    btn3.clipsToBounds = YES;
    btn3.hidden = YES;
    [self.contentView addSubview:btn3];
    self.leftBtn = btn3;
    
  
    
    
    
    
    
    /*
    if ([[NSString stringWithFormat:@"%@",_Modle.order_data[@"payment_status"]] isEqualToString:@"0"]) {
        self.leftBtn.hidden = YES;
    }else {
        self.leftBtn.hidden = NO;
    }
    */
    
    
    
    UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0, 47, SCREEN_WIDTH, 1)];
    lineView.backgroundColor = RGBAColor(240, 240, 240, 1);
    
    [self.contentView addSubview:lineView];
    
    UIView *lineView2 = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.priceLabel.frame), SCREEN_WIDTH, 1)];
    lineView2.backgroundColor = RGBAColor(240, 240, 240, 1);
    
    [self.contentView addSubview:lineView2];
    
    // 创建按钮
    CGFloat ws = 70;
    CGFloat xbtx4 = SCREEN_WIDTH - ws - space;
    UIButton *btn4 = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn4.frame = CGRectMake(xbtx4, yy, ws, 35);
    btn4.backgroundColor = [UIColor whiteColor];
    [btn4 setTitle:@"评价" forState:(UIControlStateNormal)];
    btn4.titleLabel.font = [UIFont systemFontOfSize:14];
    [btn4 setTitleColor:RGBAColor(75, 170, 251, 1) forState:(UIControlStateNormal)];
    [btn4 addTarget:self action:@selector(pingjiaORtuikuan) forControlEvents:(UIControlEventTouchUpInside)];
    btn4.layer.cornerRadius = 35/2.0;
    btn4.layer.borderWidth = 1;
    btn4.layer.borderColor = RGBAColor(75, 170, 251, 1).CGColor;
    btn4.clipsToBounds = YES;
    [self.contentView addSubview:btn4];
    btn4.hidden = YES;
    btn4.hidden = YES;
    self.rightSmallBtn = btn4;
    
    
    

    CGFloat xbtx44 = SCREEN_WIDTH - ws - space;
    UIButton *btn44= [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn44.frame = CGRectMake(xbtx44, yy, ws, 35);
    btn44.backgroundColor = [UIColor whiteColor];
    [btn44 setTitle:@"退换货" forState:(UIControlStateNormal)];
    btn44.titleLabel.font = [UIFont systemFontOfSize:14];
    [btn44 setTitleColor:RGBAColor(75, 170, 251, 1) forState:(UIControlStateNormal)];
    [btn44 addTarget:self action:@selector(tuihuo) forControlEvents:(UIControlEventTouchUpInside)];
    btn44.layer.cornerRadius = 35/2.0;
    btn44.layer.borderWidth = 1;
    btn44.layer.borderColor = RGBAColor(75, 170, 251, 1).CGColor;
    btn44.clipsToBounds = YES;
    [self.contentView addSubview:btn44];
    btn44.hidden = YES;
    self.rightBtnTuihuan = btn44;
    
    
    
    
    
    
    
    
    
    
      //订单状态 1生成订单,2支付订单,3已经发货,4完成订单,5已经评价6退款,7部分退款8用户取消订单,9作废订单,10退款中
 
    
    
    if ([_orderResult.status integerValue] == 1) {
        self.leftBtn.hidden = YES;//退换货
        self.midBtn.hidden = YES;//查看物流
        self.midBtn2.hidden = NO;//取消订单
        self.rightBtn.hidden = NO;//立即支付
        self.rightSmallBtn.hidden = YES;//评价
        self.rightBtnTuihuan.hidden = YES;
        self.rightSureBtn.hidden = YES;
        self.rightDelete.hidden = YES;
        
    }
    
  else  if ([_orderResult.status integerValue] == 2) {
        self.leftBtn.hidden = YES;//退换货左边
        self.midBtn.hidden = YES;//查看物流
        self.midBtn2.hidden = YES;//取消订单
        self.rightBtn.hidden = YES;//立即支付
        self.rightSmallBtn.hidden = YES;//评价
        self.rightBtnTuihuan.hidden = NO;//退换货右边
        self.rightSureBtn.hidden = YES;//确认收货
        self.rightDelete.hidden = YES;//删除订单
      
    }
    
  else  if ([_orderResult.status integerValue] == 3) {
        self.leftBtn.hidden = NO;//退换货
        self.midBtn.hidden = NO;//查看物流
        self.midBtn2.hidden = YES;//取消订单
        self.rightBtn.hidden = YES;//立即支付
        self.rightSmallBtn.hidden = YES;//评价
        self.rightBtnTuihuan.hidden = YES;
        self.rightSureBtn.hidden = NO;//确认收货
        self.rightDelete.hidden = YES;
 
        
    }
    
    if ([_orderResult.status integerValue] == 4) {
        self.leftBtn.hidden = YES;//退换货
        self.midBtn.hidden = YES;//查看物流
        self.rightBtn.hidden = YES;//立即支付
        self.midBtn2.hidden = YES;//取消订单
        self.rightSmallBtn.hidden = NO;//评价
        self.rightBtnTuihuan.hidden = YES;
        self.rightSureBtn.hidden = YES;
        self.rightDelete.hidden = YES;

    }
    
 
 else   if ([_orderResult.status integerValue] == 8) {
        self.leftBtn.hidden = YES;//退换货
        self.midBtn.hidden = YES;//查看物流
        self.rightBtn.hidden = YES;//立即支付
        self.midBtn2.hidden = YES;//取消订单
        self.rightSmallBtn.hidden = YES;//评价
        self.rightBtnTuihuan.hidden = YES;
        self.rightSureBtn.hidden = YES;
        self.rightDelete.hidden = NO;
    }
    
 else   if ([_orderResult.status integerValue] == 9) {
        self.leftBtn.hidden = YES;//退换货
        self.midBtn.hidden = YES;//查看物流
        self.rightBtn.hidden = YES;//立即支付
        self.midBtn2.hidden = YES;//取消订单
        self.rightSmallBtn.hidden = NO;//评价
        self.rightBtnTuihuan.hidden = YES;
        self.rightSureBtn.hidden = YES;
        self.rightDelete.hidden = YES;
     
   
    }
  else  if ([_orderResult.status integerValue] == 10||[_orderResult.status integerValue] == 6||[_orderResult.status integerValue] == 7||[_orderResult.status integerValue] == 5) {
        self.leftBtn.hidden = YES;//退换货
        self.midBtn.hidden = YES;//查看物流
        self.rightBtn.hidden = YES;//立即支付
        self.midBtn2.hidden = YES;//取消订单
        self.rightSmallBtn.hidden = YES;//评价
        self.rightBtnTuihuan.hidden = YES;
        self.rightSureBtn.hidden = YES;
        self.rightDelete.hidden = YES;
 
    }
 
    
    
}


#pragma mark －＝－＝－＝－删除订单－＝－＝－＝－＝－＝－－
//删除订单
-(void)deleteOrder:(UIButton *)sender {
    
    //取消订单
    CancelDingDanView *CancelV = [[CancelDingDanView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
    CancelV.titleStr = @"小通提示";
    CancelV.centerStr = @"真的确认删除订单吗?";
    CancelV.reloadBlock = ^(UIButton *sender){//登记回调函数，被触发就调用
        if (sender.tag == 1001) {//取消删除
            
        }
        if (sender.tag == 1002) {//确定删除
            NSDictionary *saveDic = [SaveDataMethord readLoginData];
            NSDictionary *parameDic = @{@"userid":saveDic[@"userid"],@"order_id":_Modle.order_data[@"id"],@"actoken":[Md5Apiway getMD5data:saveDic[@"userid"]]};
            
            [HttpRequest postWithURLString:POST(Shop_OrderListOrderDel) parameters:parameDic success:^(id responseObject) {
                if ([responseObject[@"ret"] intValue] != 200) {
                    [[DSLHUD shareDSLHUD] showTextNoActivity:@"删除订单出错" timeLength:1.5];
                    return ;
                }
                
                
                if(![[NSString stringWithFormat:@"%@",responseObject[@"data"][@"code"]] isEqualToString:@"0"]){
                    [MBProgressHUD showText:responseObject[@"data"][@"msg"]];
                    return;
                }
                [MBProgressHUD showText:responseObject[@"data"][@"msg"]];
                
            } failure:^(NSError *error) {
                
            }];
            

        }
        
    };
    [[UIApplication sharedApplication].keyWindow addSubview:CancelV];

    
    
    
}

#pragma mark －＝－＝－＝－立即支付－＝－＝－＝－＝－＝－－
//立即支付
- (void)zhifuORshouhuoORchakan{
   // [MBProgressHUD showText:@"立即支付"];
    //物流
    PayForViewController *payF = [[ PayForViewController alloc] init];
    payF.hidesBottomBarWhenPushed = YES;
    payF.orderIdStr = _Modle.order_data[@"order_no"];
    payF.payMoenyStr = _Modle.order_data[@"order_price"];
    [currentVC.navigationController pushViewController:payF animated:YES];
}


#pragma mark －＝－＝－＝－ 确认收货－＝－＝－＝－＝－＝－－
//确认收货
- (void)sureGetGoodsAction:(UIButton *)sender {
    
    
}


#pragma mark －＝－＝－＝－取消订单－＝－＝－＝－＝－＝－－
//取消订单
- (void)cencleOrderAction:(UIButton *)sender {
    
    
    //取消订单
    CancelDingDanView *CancelV = [[CancelDingDanView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
    CancelV.titleStr = @"小通提示";
    CancelV.centerStr = @"真的确认取消订单吗?";
    CancelV.reloadBlock = ^(UIButton *sender){//登记回调函数，被触发就调用
        if (sender.tag == 1001) {//取消 取消
            
        }
        if (sender.tag == 1002) {//确定 取消
                 NSLog(@"2");
            NSDictionary *saveDic = [SaveDataMethord readLoginData];
            NSDictionary *parameDic = @{@"userid":saveDic[@"userid"],@"order_id":_Modle.order_data[@"id"]};
            
            [HttpRequest postWithURLString:POST(Shop_OrderCancel) parameters:parameDic success:^(id responseObject) {
                
                if ([[responseObject objectForKey:@"ret"] integerValue] == 200) {
                    if ([[responseObject objectForKey:@"code"] integerValue] != 0) {
                        [MBProgressHUD showText:[[responseObject objectForKey:@"data"] objectForKey:@"msg"]];
                    }else{
                        [MBProgressHUD showText:@"取消订单成功"];
                    }
                }
                
                NSLog(@"%@",responseObject);
                
            } failure:^(NSError *error) {
                
            }];
            
        }
   
    };
    [[UIApplication sharedApplication].keyWindow addSubview:CancelV];
    
    

}


#pragma mark －＝－＝－＝－查看物流－＝－＝－＝－＝－＝－－
//查看物流
- (void)wuliuORquxiao{
    

    
    //物流
    WuLiuViewController *wuliuVC = [[ WuLiuViewController alloc] init];
    wuliuVC.hidesBottomBarWhenPushed = YES;
   [currentVC.navigationController pushViewController:wuliuVC animated:YES];
}

- (void)tuihuo{
  /*
   {
   "all_sku_num" = 1;
   "all_sku_weight" = "0.05";
   "delivery_price_real" = 0;
   id = 87;
   "order_no" = 20170911093826635826;
   "order_price" = 190;
   "payment_id" = 0;
   "payment_status" = 0;
   "promotion_price" = 1000;
   "shop_id" = 2;
   "sku_list" =     (
   {
   "goods_id" = 17;
   "goods_name" = "\U5f90\U4f20\U5e05\U5e97\U94fa\U7684\U7f8e\U5473\U67da\U5b50";
   id = 113;
   "is_groupbuy" = 0;
   "is_refund" = 0;
   "is_send" = 0;
   "order_id" = 87;
   "shop_id" = 2;
   "sku_id" = 20;
   "sku_image" = "http://bs.m0571.com/uploads/2017/08/15/45198f2e72c5772e305458fe71a7e895.png";
   "sku_market_price" = 100;
   "sku_no" = "1502782798-1";
   "sku_num" = 1;
   "sku_sell_price_real" = 200;
   "sku_value" =             (
   {
   name = "\U54c1\U79cd";
   note = "";
   type = 1;
   value = "\U4e2d\U56fd\U5927\U67da\U5b50";
   }
   );
   "sku_weight" = 50;
   }
   );
   "sku_price" = 100;
   "sku_price_real" = 200;
   status = 1;
   "u_id" = 11;
   }
   */

  
    
    
    // 退货
    TuiHuanDetailViewController *vc = [[TuiHuanDetailViewController alloc] init];
    vc.orderID = _Modle.order_data[@"id"];
    vc.telPhoneNum = _Modle.shop_data[@"tel"];
    vc.hidesBottomBarWhenPushed = YES;
    [currentVC.navigationController pushViewController:vc animated:YES];
    
    
    

    
}


#pragma mark  -=-=-=-=-=评论洁面－－＝－＝－
- (void)pingjiaORtuikuan{
   
    PublicLanguageVController *pub = [[PublicLanguageVController alloc] init];
    pub.hidesBottomBarWhenPushed = YES;
    pub.typeStrTemp = @"cellView";
    pub.modle = _Modle;
    [currentVC.navigationController pushViewController:pub  animated:YES];
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
    return self.imageArray.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
    DingDanTableCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
    
    [cell.imgV sd_setImageWithURL:[NSURL URLWithString:self.imageArray[indexPath.item]] placeholderImage:[UIImage imageNamed:@"quetu"]];
    
    
    return cell;
}

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
    
}


-(void)cancelOrConfirm:(NSInteger)cancel{
    if (cancel == 0) {
        NSLog(@"取消");
    }else{
        NSLog(@"确认");
    }
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
